#ifndef __MARS_MACRO_H__
#define __MARS_MACRO_H__

#define SAFE_DELETE( p ) if ( p ) { delete p; p = 0; }
#define SAFE_DELETE_ARRAY( p ) if ( p ) { delete[] p; p = 0; }
#define SAFE_RELEASE( p ) if ( p ) { p->Release(); p = 0; }

#define MARS_MEMSET( pDst, value, size ) do { memset( pDst, value, size ); } while ( 0 );
#define MARS_MEMCPY( pDst, pSrc, size )  do { memcpy( pDst,  pSrc, size ); } while ( 0 );

#define MARS_STREQUAL( lhs, rhs ) strcmp( lhs, rhs ) == 0

#define MARS_ASSERT( p ) do { assert( p ); } while ( 0 );

#define MARS_NO_INIT_ASSIGNMENT( class_name ) \
	class_name( const class_name & ); \
	class_name & operator = ( const class_name & );

#endif // end of #ifndef __MARS_MACRO_H__